<?
//inculde即可以使用data数据。本页所有的data数据，倾在controller都处理好

//接口触发，不能判断checkA。平常操作，可以检查。这里要判断以下来路ip再确定
//include_once("../../../common/modules/checkA.php");
include_once("../../../../config.php");
include_once("../../../../api/miniapp/wxpay.php");
//引入所有子系统信息
include_once("../../../common/model/extender_import.php");

$act = $_REQUEST['act'];

//print_r2($_REQUEST);

if($act == 'refundOrder'){

    //获取的nid是event member中的 nid
    $order_id         = $_REQUEST['order_id'];
    $price            = $_REQUEST['price'];
    //print_r2($_REQUEST);


    $wechat_info = select_one_line_all_items($table_Prefix . 'app_wx', 'nid = 1');
    $wxpay       = new Wxpay($wechat_info);



    //print_r2($event_member_info);

    //获取这个订单信息
    $order_info = select_one_line_all_items($table_Prefix.'order_info',"order_id = '{$order_id}'");
    //print_r2($order_info);


    $order_info['refund_price_admin'] =$price;

    if($order_info ){
      //echo "runing ajax controller";
      return  $wxpay->refundOrder($order_info);
    }




    $arr['status'] = 300;
    $arr['info'] = '退款失败';
    die(json_encode($arr)) ;

}
?>








